package com.lantosec.hmrp.modules.category.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lantosec.hmrp.modules.category.entity.AssetsPrintTemplate;
import com.lantosec.hmrp.modules.category.mapper.AssetsPrintTemplateMapper;
import com.lantosec.hmrp.modules.category.service.IAssetsPrintTemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.context.annotation.Primary;
import lombok.extern.log4j.Log4j2;

import java.util.List;

/**
 * <p>
 * 资产标签打印模板 服务实现类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-07
 */
@Service
@Primary
@Log4j2
public class AssetsPrintTemplateServiceImpl extends ServiceImpl<AssetsPrintTemplateMapper, AssetsPrintTemplate> implements IAssetsPrintTemplateService {
    @Override
    public List<AssetsPrintTemplate> getTemplate(String templateType) {
        List<AssetsPrintTemplate> param = baseMapper.selectList(new QueryWrapper<AssetsPrintTemplate>()
                .eq(StringUtils.isNotEmpty(templateType), String.valueOf(AssetsPrintTemplate.ColName.template_type), templateType));
        return param;
    }
}
